//
//  SSPromotion.m
//  textDemo
//
//  Created by Esther on 2017/2/21.
//  Copyright © 2017年 Esther. All rights reserved.
//

#import "SSPromotion.h"
#import "SSNetworkTools.h"

@implementation SSPromotion


+ (void)loadPromotionData:(void (^)(NSArray<SSPromotion *> *))completeBlock{
    NSDictionary *parameters = @{@"call" : @8};
    [[SSNetworkTools shared] ss_postLoadData:@"loveBeen/promotion.json.php" parameters:parameters completeBlock:^(id responseObject, NSError *error) {
        if (error != nil) {
            return ;
        }
        NSArray *arr = responseObject[@"data"];
        NSMutableArray *tempArrM = [NSMutableArray array];
        
        for (NSDictionary *dict in arr) {
            
            SSPromotion *promotion = [self yy_modelWithDictionary:dict];
            [tempArrM addObject:promotion];
            
        }
        if (completeBlock) {
            completeBlock(tempArrM.copy);
            
        }
    }];
}
@end
